/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents;

import MainClasses.Event.Event;
import MainClasses.main;
import java.awt.Container;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
 *
 * @author andrewcutler
 */
public class ListEventFrame extends JFrame{

    public ListEventFrame()
    {
        super("List of Events");
        
        Container content = this.getContentPane();
        content.setLayout(new BoxLayout(content, BoxLayout.PAGE_AXIS));
        if(main.getUserCourse().getEvents().size() == 0)
        {
            content.add(new JLabel("No Events to list."));
        }
        for(Event e : main.getUserCourse().getEvents())
        {
            content.add(e.getPanel());
        }
        
        pack();
    }
}
